package org.jeecg.report.enums;

import lombok.Getter;

@Getter
public enum SpcD4Enum {
    D4_2(3.267, 2),
    D4_3(2.574, 3),
    D4_4(2.282, 4),
    D4_5(2.114, 5),
    D4_6(2.004, 6),
    D4_7(1.924, 7),
    D4_8(1.864, 8),
    D4_9(1.816, 9),
    D4_10(1.777, 10),
    D4_11(1.744, 11),
    D4_12(1.717, 12),
    D4_13(1.693, 13),
    D4_14(1.672, 14),
    D4_15(1.653, 15),
    D4_16(1.637, 16),
    D4_17(1.622, 17),
    D4_18(1.608, 18),
    D4_19(1.597, 19),
    D4_20(1.585, 20);
    // 成员变量
    private final Double constant;
    private final int num;

    // 构造方法
    SpcD4Enum(Double constant, int num) {
        this.constant = constant;
        this.num = num;
    }

    // 普通方法
    public static Double getConstant(int num) {
        for (SpcD4Enum c : SpcD4Enum.values()) {
            if (c.getNum() == num) {
                return c.constant;
            }
        }
        return null;
    }
}
